from abc import ABC,abstractmethod
from typing import Mapping

from autogen_agentchat.base import ChatAgent
from autogen_core import ComponentBase
from pydantic import BaseModel
from typing import Any, AsyncGenerator, Mapping, Sequence
class ButlerTeam(ABC,  ComponentBase[BaseModel]):
    component_type = "team"
    @abstractmethod
    async def reset(self) -> None:
        """
        重置团队成员回到初始状态.
        """
        ...

    @abstractmethod
    async def pause(self) -> None:
        """暂停团队及其所有参与者。这对于暂停:meth:`autogen_agentchat.base.TaskRunner.run`或
        :meth:`autogen_agentchat.base.TaskRunner.run_stream`方法的并发执行同时保持它们运行状态非常有用。"""
        ...

    @abstractmethod
    async def resume(self) -> None:
        """在调用:meth:`pause`方法暂停后，恢复团队及其所有参与者的运行。"""
        ...

    @abstractmethod
    async def save_state(self) -> Mapping[str, Any]:
        """保存团队的当前状态。"""
        ...

    async def load_state(self, state: Mapping[str, Any]) -> None:
        """加载团队的状态。"""
        ...

    @abstractmethod
    async def start(self) -> None:
        """
        启动团队运行。
        """
        ...

    @abstractmethod
    async def add_member(self, member: ChatAgent) -> None:
        """
        添加成员到团队。

        Args:
            member: 要添加的团队成员
        """
        ...

    @abstractmethod
    async def remove_member(self, member_id: str) -> None:
        """
        从团队中删除成员。

        Args:
            member_id: 要删除的成员ID
        """
        ...

    @abstractmethod
    async def stop(self) -> None:
        """
        停止团队运行。
        """
        ...